﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ScrumProject.Models
{
    public class Task
    {
        public Task()
        {
            this.RealizedWorks = new List<RealizedWork>();
            
        }
        [DisplayName("Task Id")]
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        [Required]
        public string Description { get; set; }
        
        [RegularExpression("^\\+?\\d+$", ErrorMessage = "Must be a Positive Non-decimal Number")]
        public Nullable<double> WorkRemaining { get; set; }
        
        [Required]
        public int Status { get; set; }
        [Required]
        public Nullable<int> StoryId { get; set; }
        public virtual Story Story { get; set; }
        public virtual ICollection<RealizedWork> RealizedWorks { get; set; }
        [Required]
        public Nullable<int> UserId { get; set; }
        
    }
}